 <template>
  <div style="display: flex; justify-content: center; align-items: center">
    <div
      id="animatedElement"
      style="font-size: 88px"
      class="animate__animated animate__fadeInDownBig"
    >
      <span>{{ msg }}</span>
    </div>
  </div>
</template>


<script setup lang="ts">
import aardio from "aardio";
import { onMounted, ref } from "vue";
import "animate.css/animate.min.css";
const msg = ref("ce123测试");
onMounted(() => {
  aardio
    .getMsg()
    .then((result) => {
      msg.value = result;
      startAnimationSequence();
    })
    .catch((error) => {});
});

function startAnimationSequence() {
  const element = document.getElementById("animatedElement");
  element?.addEventListener("animationend", function onAnimationEnd() {
    element.classList.remove("animate__fadeInDownBig");
    element.classList.add("animate__animated", "animate__heartBeat");
    element.removeEventListener("animationend", onAnimationEnd);
    element?.addEventListener("animationend", function onAnimationEnd() {
      element.classList.remove("animate__heartBeat");
      element.classList.add("animate__animated", "animate__hinge");
      element.removeEventListener("animationend", onAnimationEnd);
      element?.addEventListener("animationend", function onAnimationEnd() {
        element.classList.remove("animate__hinge");
        element.classList.add("animate__animated", "animate__fadeInDownBig");
        element.removeEventListener("animationend", onAnimationEnd);
        startAnimationSequence();
      });
    });
  });
}
</script>

<style scoped>
header {
  line-height: 1.5;
}

.logo {
  display: block;
  margin: 0 auto 2rem;
}

@media (min-width: 1024px) {
  header {
    display: flex;
    place-items: center;
    padding-right: calc(var(--section-gap) / 2);
  }

  .logo {
    margin: 0 2rem 0 0;
  }

  header .wrapper {
    display: flex;
    place-items: flex-start;
    flex-wrap: wrap;
  }
}

body {
  font-family: "myFont" !important;
}
</style>
